package com.lk.security.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;

/**
 * 加载认证信息配置类
 *
 * @author likang
 */
@Configuration
public class ReloadMessageConfig {

  /** 加载中文的认证提示信息 */
  @Bean
  public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource =
        new ReloadableResourceBundleMessageSource();
    // .properties 不要加到后面
    messageSource.setBasename("classpath:org/springframework/security/messages_zh_CN");
    return messageSource;
  }
}
